GridDestroyInteger Subroutine

private subroutine GridDestroyInteger(layer)

deallocate integer grid

Arguments

Type IntentOptional Attributes Name
type(grid_integer), intent(inout) :: layer

Variables

Type Visibility Attributes Name Initial
integer(kind=short), public :: ios

Source Code

SUBROUTINE GridDestroyInteger &
!
(layer)

IMPLICIT NONE

! Arguments with intent(inout):
TYPE (grid_integer), INTENT(INOUT) :: layer

! Local variables:
INTEGER (KIND = short)          :: ios 
!------------end of declaration------------------------------------------------

IF ( ALLOCATED (layer % mat) ) THEN
  DEALLOCATE ( layer % mat, STAT = ios )
  IF (ios /= 0) THEN
    CALL Catch ('error', 'GridLib',      &
    'memory deallocating grid integer ' ,  &
    code = memAllocError                 )
  END IF
END IF

!deallocate coordinate reference system
IF ( ALLOCATED ( layer % grid_mapping % param) ) THEN
  DEALLOCATE ( layer % grid_mapping % param, STAT = ios )
  IF (ios /= 0) THEN
    CALL Catch ('error', 'GridLib',      &
    'memory deallocating grid float ' ,  &
    code = memAllocError                 )
  END IF
END IF

IF ( ALLOCATED ( layer % grid_mapping % description) ) THEN
  DEALLOCATE ( layer % grid_mapping % description, STAT = ios )
  IF (ios /= 0) THEN
    CALL Catch ('error', 'GridLib',      &
    'memory deallocating grid float ' ,  &
    code = memAllocError                 )
  END IF
END IF

END SUBROUTINE GridDestroyInteger